Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat HDS 2352 enable versioned documentation #1349

Merged
merged 25 commits into from
Nov 21, 2024

Conversation

timwessman
Copy link
Contributor

@timwessman timwessman commented Sep 5, 2024

Description

Configured Gatsby to read documentation from different git branches in addition to local files. This makes it possible for a user to select which version of documentation is viewed. Header.ActionBarItem is used to choose versions in a dropdown menu.

Related Issue

Closes HDS-2352

Motivation and Context

When users update their HDS versions, they need to compare changes. Currently, previous versions are only available deep in GitHub, and therefore, they’re difficult to find.

Open issues

  • This PR is kind of a poc of multi-version documentation. To improve the UX, there is a separate design ticket HDS-2387.
  • There is some problem with webpack configuration. WebPack splits prerendered content into so-called "chunks", but building fail with the default config. If there is not much content, splitting doesn't happen, and the building succeeds. So, I made a bigger chunk size to avoid splitting. This needs more investigation if we want more than three versions.
  • All internal link hrefs are replaced with URLs with a version prefix, but for some reason, links in the content of sub-pages of /about, /foundation, and /patterns always link to the latest version. This has to be fixed, but I haven't found a way yet.

How Has This Been Tested?

Demos:

Screenshots (if appropriate):

Add to changelog

  • Added needed line to changelog

Copy link

github-actions bot commented Sep 5, 2024

Test Results

  1 files   64 suites   11m 43s ⏱️
 60 tests  60 ✅ 0 💤 0 ❌
120 runs  120 ✅ 0 💤 0 ❌

Results for commit afa8cb0.

♻️ This comment has been updated with latest results.

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from ae9fb2e to 60b149c Compare September 9, 2024 07:04
@timwessman timwessman marked this pull request as ready for review September 10, 2024 07:44
Copy link
Contributor

@laurakarhu laurakarhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from 60b149c to 35c1192 Compare October 17, 2024 13:12
@timwessman timwessman changed the base branch from development to release-4.0.0 October 17, 2024 13:17
@timwessman
Copy link
Contributor Author

Fixed Webpack chunking problems and problem of redirecting some internal links. Rebased onto 4.0.0

@timwessman timwessman changed the title WIP: feat HDS 2352 enable versioned documentation feat HDS 2352 enable versioned documentation Oct 17, 2024
Copy link

Preview found from hds-demo docs/preview_1349

Demos

Docs
Core Storybook
React Storybook

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch 2 times, most recently from f3181eb to 4b93ca4 Compare October 25, 2024 07:17
@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch 3 times, most recently from a8bb077 to 5a693d2 Compare November 7, 2024 07:38
@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch 2 times, most recently from 861f2fc to ba2ebdc Compare November 13, 2024 17:15
@NikoHelle
Copy link
Contributor

NikoHelle commented Nov 14, 2024

The hero on frontpage seems broken. Missing image is ok, but otherwise.

Current hds.hel.fi:
image

Demo:
image

@NikoHelle
Copy link
Contributor

The menu looks funny. Color seems odd and does our component create that much repetition? "4.0.0." so many times

image

@timwessman
Copy link
Contributor Author

timwessman commented Nov 14, 2024

The menu looks funny. Color seems odd and does our component create that much repetition? "4.0.0." so many times
image

Yep, this is our default ActionBarItem with sub items. I try to do something

@timwessman timwessman closed this Nov 14, 2024
@timwessman timwessman reopened this Nov 14, 2024
@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from 5a39c0e to 5bbe27c Compare November 14, 2024 22:57
@timwessman
Copy link
Contributor Author

Fixed:

  • Home page layout didn't let Hero to render correctly
  • Version menu show now selected item and don't show unnesessary red Heading row
  • Documentation use now correct hds-core and hds-react package versions for older documentation pages
  • Added 2.17.1 documentation
  • Fixed small bug that showed removed components on latest versions navigation
  • Commented out broken pages list, as it looks like that wrong hds-react version was the problem on those and these pages don't crash the build now. I leave the empty list there, if some pages still need blacklisting
  • Commented out webpack chunk split optimization, because documentation is now much bigger and I didn't find adjustment to avoid FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory :-) I leave the commented out settings there if there is still need to use it

@timwessman
Copy link
Contributor Author

Version menu is better now: Screenshot 2024-11-15 at 9 28 44

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from 589442b to c6451d0 Compare November 18, 2024 08:30
@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from c6451d0 to a928814 Compare November 20, 2024 11:02
@timwessman
Copy link
Contributor Author

Home page styles are weird on demo site url. But on local build it looks now correct to me
Screenshot 2024-11-20 at 15 25 46

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from 6c194b7 to afa8cb0 Compare November 20, 2024 14:28
Copy link
Contributor

@laurakarhu laurakarhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Contributor

@mrTuomoK mrTuomoK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 it :D

@timwessman timwessman merged commit 20f3555 into release-4.0.0 Nov 21, 2024
8 checks passed
@timwessman timwessman deleted the HDS-2352-enable-versioned-documentation branch November 21, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants